package _lianbiao;
import java.util.*;
public class _26 {
    public boolean hasCycle(ListNode head) {
        ListNode fast =head;
        ListNode low =head;
        while(fast!=null&&fast.next!=null){
            low=low.next;
            fast = fast.next.next;
            if(low==fast){
                return true;
            }
        }
        return false;
    }
}
